﻿<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="Products.aspx.cs" Inherits="CoolCode.Web.UI.Views.Check.Products"
    %>

<%@ Register Src="~/Controls/ProductFilter.ascx" TagName="ProductFilter" TagPrefix="uc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>产品管理</title>
</head>
<body>
    <form id="form1" runat="server">
    <ajaxToolkit:ToolkitScriptManager ID="tsmAjax" runat="server">
        <Scripts>
            <asp:ScriptReference Path="~/Content/js/Common.js" />
        </Scripts>
        <Services>
            <asp:ServiceReference Path="~/WebServices/ProductService.asmx" />
        </Services>
    </ajaxToolkit:ToolkitScriptManager>

    <script type="text/javascript">
        function Delete(id) {
            WebServices.ProductService.Delete(id, function(result) {
                var div = $get('products');
                if (div) {
                    div.innerHTML = result;
                    alert('删除成功');
                    return;
                }

                alert('删除失败');
            });
        }
    </script>

    <cc:Loading ID="Loading1" runat="server"></cc:Loading>
    <!--Title -->
    <div class="HeaderTitle">
        <asp:Label ID="SCRHDR" runat="server" Text="产品管理"></asp:Label>
    </div>
    <asp:Panel ID="pnlMaster" runat="server" CssClass="HeaderSearch">
        <uc:ProductFilter runat="server" ID="productFilter">
        </uc:ProductFilter>
    </asp:Panel>
    <!--Grid-->
    <asp:UpdatePanel ID="udpHeader" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <div class="HeaderToolbar">
                <asp:LinkButton ID="lnkSearch" runat="server" CausesValidation="False" Text="搜索" />&nbsp;
                <%-- <asp:LinkButton ID="lnkAdd" runat="server" CausesValidation="False">Add</asp:LinkButton>--%>
                <a href="CreateProduct.aspx" target="_blank">添加</a>&nbsp; <a href="#" onclick="refresh();">
                    刷新</a>&nbsp;
            </div>
            <div id="products" class="HeaderGridView">
                <asp:GridView ID="gvMaster" runat="server" SkinID="gvMaster">
                    <Columns>
                        <asp:TemplateField ItemStyle-Width="80">
                            <HeaderTemplate>
                                <div>
                                    <asp:Label ID="Operation" runat="server" Text="操作"></asp:Label></div>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <div>
                                    <a id="lnkEdit" href='CreateProduct.aspx?key=<%#Eval("ID") %>&product=<%#Eval("ProductID") %>'>编辑</a>
                                    <asp:LinkButton ID="lnkDelete" runat="server" CommandName="Delete" CommandArgument='<%#Eval("ID") %>'
                                        OnClientClick="if(!confirm('你确认要删除吗？'))return false;">删除</asp:LinkButton>
                                    <%-- <a href='#' onclick="Delete('<%#Eval("ID") %>');">删除</a>
                                    <asp:LinkButton ID="lnkEdit" runat="server" CommandName="Edit"></asp:LinkButton>--%>
                                </div>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="ID" HeaderText="" ItemStyle-Width="1" ItemStyle-CssClass="RightColumns"
                            Visible="false" />
                        <asp:BoundField DataField="Line" HeaderText="序号" ItemStyle-Width="50" ItemStyle-CssClass="RightColumns"
                            Visible="false" />
                        <asp:BoundField DataField="ProductID" HeaderText="产品编号" ItemStyle-Width="100" ItemStyle-CssClass="LeftColumns" />
                        <asp:BoundField DataField="ProductSpec" HeaderText="产品规格" ItemStyle-Width="50" ItemStyle-CssClass="LeftColumns" />
                        <asp:BoundField DataField="Checker" HeaderText="检验员" ItemStyle-Width="100" ItemStyle-CssClass="LeftColumns" />
                        <asp:BoundField DataField="CheckDate" HeaderText="检验时间" ItemStyle-Width="150" ItemStyle-CssClass="RightColumns"
                            ItemStyle-Wrap="false" DataFormatString="{0:yyyy-MM-dd}" HtmlEncode="false" />
                        <asp:BoundField DataField="Face" HeaderText="胶面" ItemStyle-Width="80" ItemStyle-CssClass="LeftColumns" />
                        <asp:BoundField DataField="Burse" HeaderText="囊" ItemStyle-Width="80" ItemStyle-CssClass="LeftColumns" />
                        <asp:BoundField DataField="Drawback" HeaderText="缩腰件" ItemStyle-Width="80" ItemStyle-CssClass="LeftColumns" />
                        <asp:BoundField DataField="Appearance" HeaderText="外观" ItemStyle-Width="90" ItemStyle-CssClass="LeftColumns" />
                        <asp:BoundField DataField="OutsideDiameter" HeaderText="胶面外径（远/近）" ItemStyle-Width="120"
                            ItemStyle-CssClass="LeftColumns" />
                        <asp:BoundField DataField="ConeHeight" HeaderText="椎体高度" ItemStyle-Width="100" ItemStyle-CssClass="RightColumns" />
                        <asp:BoundField DataField="SacculusLength" HeaderText="球囊长度" ItemStyle-Width="100"
                            ItemStyle-CssClass="RightColumns" />
                        <asp:BoundField DataField="SacculusStretch" HeaderText="球囊伸长长度" ItemStyle-Width="100"
                            ItemStyle-CssClass="RightColumns" />
                        <asp:BoundField DataField="StressTest" HeaderText="220KPa压力测试（外径/长度）" ItemStyle-Width="180"
                            ItemStyle-CssClass="LeftColumns" />
                        <asp:BoundField DataField="Interlayer" HeaderText="夹层" ItemStyle-Width="30" ItemStyle-CssClass="LeftColumns" />
                        <asp:BoundField DataField="Degumming" HeaderText="脱胶、反胶" ItemStyle-Width="30" ItemStyle-CssClass="LeftColumns" />
                        <asp:BoundField DataField="Remark" HeaderText="备注" ItemStyle-CssClass="LeftColumns"
                            ItemStyle-Width="200" />
                        <asp:BoundField DataField="Status" HeaderText="状态" ItemStyle-Width="30" ItemStyle-CssClass="LeftColumns"
                            Visible="false" />
                        <asp:BoundField DataField="PassODFar" HeaderText="" ItemStyle-Width="1" ItemStyle-CssClass="RightColumns"
                            Visible="false" />
                        <asp:BoundField DataField="PassODClose" HeaderText="" ItemStyle-Width="1" ItemStyle-CssClass="RightColumns"
                            Visible="false" />
                        <asp:BoundField DataField="PassConeHeight" HeaderText="" ItemStyle-Width="1" ItemStyle-CssClass="RightColumns"
                            Visible="false" />
                        <asp:BoundField DataField="PassSacculusLength" HeaderText="" ItemStyle-Width="1"
                            ItemStyle-CssClass="RightColumns" Visible="false" />
                        <asp:BoundField DataField="PassODStressTest2" HeaderText="" ItemStyle-Width="1" ItemStyle-CssClass="RightColumns"
                            Visible="false" />
                        <asp:BoundField DataField="PassStressTestLength" HeaderText="" ItemStyle-Width="1"
                            ItemStyle-CssClass="RightColumns" Visible="false" />
                    </Columns>
                    <EmptyDataTemplate>
                        <cc:EmptyData ID="EmptyData1" runat="server">
                        </cc:EmptyData>
                    </EmptyDataTemplate>
                </asp:GridView>
            </div>
            <div class="HeaderPager">
                <cc:Pager runat="server" ID="pgrMaster" />
            </div>
            <div style="clear: both;">
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>
